/***************************** BEGIN LICENSE BLOCK ***************************

 The contents of this file are subject to the Mozilla Public License Version
 1.1 (the "License"); you may not use this file except in compliance with
 the License. You may obtain a copy of the License at
 http://www.mozilla.org/MPL/MPL-1.1.html
 
 Software distributed under the License is distributed on an "AS IS" basis,
 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 for the specific language governing rights and limitations under the License.
 
 The Original Code is the "EO-SPS Framework".
 
 The Initial Developer of the Original Code is Spotimage S.A.
 Portions created by the Initial Developer are Copyright (C) 2007
 the Initial Developer. All Rights Reserved.
 
 Contributor(s): 
    Alexandre Robin <alexandre.robin@spotimage.fr>
 
******************************* END LICENSE BLOCK ***************************/

package com.spotimage.eosps;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.TimeZone;
import org.vast.util.DateTime;
import com.spotimage.eosps.EOConstants.InformationType;


/**
 * <p><b>Title:</b><br/>
 * Feasibility Study
 * </p>
 *
 * <p><b>Description:</b><br/>
 * Class containing feasibility study information as defined in the EO SPS standard.
 * </p>
 *
 * <p>Copyright (c) 2008, Spot Image</p>
 * @author Alexandre Robin <alexandre.robin@spotimage.fr>
 * @date Jun, 28th 2010
 * @since 2.0
 */
public class FeasibilityStudy extends EOReportInfo
{
	protected DateTime expirationDate;
	protected float estimatedCost = Float.NaN;
	protected float successRate;
	protected List<InformationType> informationUsed;


	public FeasibilityStudy()
	{
		informationUsed = new ArrayList<InformationType>();
	}


	public DateTime getExpirationDate()
	{
		return expirationDate;
	}


	public void setExpirationDate(DateTime expirationDate)
	{
		this.expirationDate = expirationDate;
	}
	
	
	public void setExpirationDelay(int seconds)
	{
		GregorianCalendar cal = new GregorianCalendar();
		cal.setTime(new Date());
		cal.setTimeZone(TimeZone.getTimeZone("GMT"));
		cal.add(Calendar.SECOND, seconds);
		cal.set(Calendar.MILLISECOND, 0);
		this.expirationDate = new DateTime(cal.getTimeInMillis());
	}


	public float getEstimatedCost()
	{
		return estimatedCost;
	}


	public void setEstimatedCost(float estimatedCost)
	{
		this.estimatedCost = estimatedCost;
	}


	public float getSuccessRate()
	{
		return successRate;
	}


	public void setSuccessRate(float successRate)
	{
		this.successRate = successRate;
	}


	public List<InformationType> getInformationUsed()
	{
		return informationUsed;
	}


	public void setInformationUsed(List<InformationType> informationUsed)
	{
		this.informationUsed = informationUsed;
	}


	public List<GridCell> getCells()
	{
		return cells;
	}


	public void setCells(List<GridCell> cells)
	{
		this.cells = cells;
	}


	public List<Segment> getSegments()
	{
		return segments;
	}


	public void setSegments(List<Segment> segments)
	{
		this.segments = segments;
	}
}
